﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;

namespace ERP.MasterData.Dtos
{
    /// <summary>
    /// 车间DTO
    /// </summary>
    public class WorkshopDto : EntityDto<int>
    {
        /// <summary>
        /// 车间编码
        /// </summary>
        public string WorkshopCode { get; set; }

        /// <summary>
        /// 车间名称
        /// </summary>
        public string WorkshopName { get; set; }

        /// <summary>
        /// 面积
        /// </summary>
        public decimal Area { get; set; }

        /// <summary>
        /// 负责人
        /// </summary>
        public string Manager { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsActive { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
    }

    /// <summary>
    /// 创建车间DTO
    /// </summary>
    public class CreateWorkshopDto
    {
        /// <summary>
        /// 车间编码
        /// </summary>
        [Required(ErrorMessage = "车间编码不能为空")]
        [StringLength(50, ErrorMessage = "车间编码长度不能超过50个字符")]
        public string WorkshopCode { get; set; }

        /// <summary>
        /// 车间名称
        /// </summary>
        [Required(ErrorMessage = "车间名称不能为空")]
        [StringLength(100, ErrorMessage = "车间名称长度不能超过100个字符")]
        public string WorkshopName { get; set; }

        /// <summary>
        /// 面积
        /// </summary>
        [Required(ErrorMessage = "面积不能为空")]
        [Range(0, double.MaxValue, ErrorMessage = "面积必须大于或等于0")]
        public decimal Area { get; set; }

        /// <summary>
        /// 负责人
        /// </summary>
        [StringLength(50, ErrorMessage = "负责人姓名长度不能超过50个字符")]
        public string Manager { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsActive { get; set; } = true;

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
    }

    /// <summary>
    /// 更新车间DTO
    /// </summary>
    public class UpdateWorkshopDto : CreateWorkshopDto
    {
        /// <summary>
        /// 车间ID
        /// </summary>
        public int Id { get; set; }
    }

    /// <summary>
    /// 获取车间列表输入参数DTO
    /// </summary>
    public class GetWorkshopInputDto : PagedAndSortedResultRequestDto
    {
        /// <summary>
        /// 关键字搜索
        /// </summary>
        public string Keyword { get; set; }

        /// <summary>
        /// 车间编码
        /// </summary>
        public string WorkshopCode { get; set; }

        /// <summary>
        /// 车间名称
        /// </summary>
        public string WorkshopName { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool? IsActive { get; set; }
    }

    /// <summary>
    /// 删除車間DTO
    /// </summary>
    public class DeleteWorkshopDto
    {
        /// <summary>
        /// 車間ID
        /// </summary>
        public int Id { get; set; }
    }

    /// <summary>
    /// 批量删除車間DTO
    /// </summary>
    public class BatchDeleteWorkshopsDto
    {
        /// <summary>
        /// 車間ID列表
        /// </summary>
        public List<int> Ids { get; set; } = new List<int>();
    }
}
